package com.xzh.homeliving.commodity.web;

import com.xzh.homeliving.commodity.service.SkuInfoService;
import com.xzh.homeliving.commodity.vo.SearchResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: zhiHong
 * @CreateTime: 2024-02-07 20:29
 * @Description: 搜索页面控制器
 */
@Controller
public class SearchController {
    @Resource
    private SkuInfoService skuInfoService;

    @RequestMapping("/list.html")
    public String searchList(@RequestParam Map<String, Object> params, Model model) {
        SearchResultVo searchResultVo = skuInfoService.querySearchPageByCondition(params);

        model.addAttribute("result", searchResultVo);
        return "list";
    }
}
